#reduce ---累计2
# from functools import  reduce
# a = [1,2,3,4]
# def func1(x,y):
#     return x*10 +y
# print(reduce(func1,a))
#
# 使用reduce，取出lst里得数字
# from functools import reduce
# def fn(x,y):
#     if y.isdigit():
#         return x+y
#     else:
#         return x
# lst = ['a','1','2bb','234','','9']
# print(reduce(fn,lst)[1:])

# list1 = [7,-8,5,4,0,-2,-5]
# print(sorted(sorted(list1,reverse=True),key = lambda x:x*-10 if x <= 0 else x))
# def sorted_s(item):
#     for i in item:
#         if i.islower():
#             return (False,False,i)
#         elif i.isupper():
#             return (False,True,i)
#         elif int(i)%2:
#             return (True,False,i)
#         else:
#             return (True,True,i)
# s = 'asdf234GDSdsf23'
# print(sorted(s,key=sorted_s))